The primary function of a shaft oil seal is to retain lubricating fluids within the system while preventing the ingress of external contaminants. This is particularly important in high-speed applications where the loss of lubricant or the entry of contaminants could lead to rapid wear and damage to the equipment.